<template>
	<view>

		<view class="userInfo" v-if="userInfo">
			<image :src="userInfo.avatar" mode=""></image>
			<text>{{userInfo.nickname}}</text>
		</view>
		<view class="userInfo" v-else>
			<navigator url="/pages/login/login">
				<button>去登陆</button>
			</navigator>
		</view>
	</view>
</template>

<script setup>
	import {
		ref
	} from 'vue';
	import { onShow } from '@dcloudio/uni-app'
	const userInfo = ref(uni.getStorageSync('userInfo'))
	
	onShow(() => {
		userInfo.value = uni.getStorageSync('userInfo')
	})
</script>

<style lang="scss" scoped>

</style>